package com.example.test05;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        // 加载Spring配置，初始化容器
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(ThreadPoolConfig.class);

        // 获取服务类并执行任务
        TaskService taskService = context.getBean(TaskService.class);
        taskService.startTask();

        // 不关闭容器，避免任务被终止
    }
}
